package com.nti56.springboot.utils;



public class Constant {
	
	public static final String SESSION_USER_KEY = "_sess_user_key";
	
	/**
	 * 用户授权资源 URL
	 */
	public static final String SESSION_USER_AUTH_URL = "_sess_user_auth_url";
	public static final String SESSION_USER_AUTH_ACCORDION = "_sess_user_auth_accordion";
	//用户授权的部门
	public static final String SESSION_USER_DATA_ORG = "_sess_user_data_org";
	
	public static final String LMIS_INTERFACE = "TMS_INTERFACE";  
	
	/*数字相关*/
	public static final String ZERO_STR = "0";  
	
	/*符号相关*/
	public static final String BLANK = " ";  
	public static final String CAMA	= ",";  
	public static final String QUOTATION_MARKS	= "'";  
	public static final String LEFT_BRACKET = "(";
	public static final String RIGHT_BRACKET = ")";
	public static final String QUESTION_MARK = "?";
	
	public static final String RIGHT_SLASH = "\\";
	public static final String LEFT_SLASH = "/";
	public static final String MINUS_SIGN = "-";
	public static final String DOWN_MINUS_SIGN = "_";

	/*数据库相关*/
	public static final String DB_TYPE_ORACLE = "oracle";
	public static final String DB_TYPE_SQL_SERVER = "sqlserver";
	public static final String DB_TYPE_SQL_SERVER_2000 = "sqlserver2000";
	public static final String DB_TYPE_DB2 = "db2";
	
    public static final String DB_DATETIME_FORMAT = "yyyy-MM-dd HH24:mi:ss";
    public static final String DB_DATE_FORMAT = "yyyy-MM-dd";
    
	public static final String DB_ORACLE_FUNCTION_SYSDATE = "sysdate";
	public static final String DB_ORACLE_FUNCTION_SYS_GUID = "sys_guid()";
	public static final String DB_ORACLE_FUNCTION_COUNT = "count(*)";
	public static final String DB_ORACLE_FUNCTION_TO_DATE = "to_date";

	public static final String DB_ORACLE_FUNCTION_TO_DATE_COMPLETE =DB_ORACLE_FUNCTION_TO_DATE
			+LEFT_BRACKET +QUOTATION_MARKS+QUOTATION_MARKS+"{0}"+QUOTATION_MARKS+QUOTATION_MARKS
			+CAMA+QUOTATION_MARKS+QUOTATION_MARKS+"{1}"+QUOTATION_MARKS+QUOTATION_MARKS+RIGHT_BRACKET;
	
	public static final String SQL_PAGE_ORACLE ="select * from ( select a.*, rownum rn from ({0} ) a where rownum <= {1} ) where rn > {2}";
	public static final String SQL_PAGE_DB2 =	"select * from (select A.*,rownumber() over(order by {0} asc ) as rowid from ({1}) A) where rowid <={2} and rowid > {3}";
	public static final String SQL_PAGE_MY_SQL ="select * from ({0}) A limit {1},{2}";
	public static final String SQL_PAGE_SQL_SERVER ="";
	public static final String SQL_PAGE_SQL_SERVER_2000 ="select top {0} * from ({1}) A where {2} not in(select top {3} {2} from ({1}) B order by {2}) order by {2}";
	
	public static final String DB_SQL_SERVER_FUNCTION_GETDATE	= "getdate()";
	public static final String DB_SQL_SERVER_FUNCTION_CURRENT_TIMESTAMP	= "current_timestamp()";
	
	public static final String DB_SQL_SERVER_FUNCTION_CONVERT_DATETIME	= "CONVERT(varchar(100), ''{0}'', 120)";//2006-05-16 10:57:49 
	public static final String DB_SQL_SERVER_FUNCTION_CONVERT_DATE	= "CONVERT(varchar(100), ''{0}'', 23)";//2006-05-16  
	

	public static final String DB_DB2_FUNCTION_CURRENT_DATE	= "current_date";
	
	public static final String SQL_SPLIT_JOINT_STR	= "||";
	public static final String SQL_AS_STR	= "as";
	public static final String SQL_AND_STR	= "and";
	public static final String SQL_SELECT_STR	= "select";
	public static final String SQL_INSERT_STR	= "insert";
	public static final String SQL_UPDATE_STR = "update";
	public static final String SQL_DELETE_STR = "delete";
	public static final String SQL_INTO_STR	= "into";
	public static final String SQL_VALUES_STR = "values";
	public static final String SQL_FROM_STR	= "from";
	public static final String SQL_SET_STR = "set";
	public static final String SQL_TRIM_STR = "trim";
	public static final String SQL_WHERE_STR = "where";
	public static final String SQL_EQUAL_STR = "=";
	
	
	public static final String IS_ID_COLUMN = "1";
	
	public static final String ACTION_SQL_TYPE_BEFORE = "0";
	public static final String ACTION_SQL_TYPE_AFTER = "1";
	
	
	
	public static final String RESOURCE_TYPE_URL = "1";
	public static final String RESOURCE_TYPE_BUTTON = "2";
	public static final String RESOURCE_TYPE_ACCORDION = "3";
	
	
	public static final String CRON_JOB_STATUS_OPEN = "1";
	public static final String CRON_JOB_STATUS_CLOSED = "0";
	
	//系统超级管理员用户名
	public static final String SYSTEM_SUPER_ADMIN_NAME ="admin";
	
	public static final String TMS_REGISTRY_NAME = "TMSInterface";
	//成品，辅料，原料 同步按钮
	public static final String TMS_REGISTRY_KEY_CP_MATRIX = "CP_MATRIX";
	public static final String TMS_REGISTRY_KEY_YL_MATRIX = "YL_MATRIX";
	public static final String TMS_REGISTRY_KEY_FL_MATRIX = "FL_MATRIX";
	
	public static final String TMS_REGISTRY_KEY_MILEAGE = "MILEAGE";
	
	public static final String TMS_REGISTRY_KEY_ORDER = "Order";
	public static final String TMS_REGISTRY_VALUE_ENABLE = "1";
	public static final String TMS_REGISTRY_VALUE_DISABLE = "0";
	
	public static final String CACHE_PROVINCECITY_TREENODELIST ="cache_provincecity_treenodelist";
	public static final String CACHE_PROVINCECITYS ="cache_provincecitys";
	
	public static final String CACHE_ORGANIZATION_TREENODELIST ="cache_organization_treenodelist";
	
	public static final String CACHE_DCORGANIZATION_TREENODELIST ="cache_dcorganization_treenodelist";
	
	public static final String CACHE_ORGANIZATIONS ="cache_organizations";
	
	public static final String CACHE_REPERTOTY ="cache_repertoty";
	
	public static final String CACHE_CARRIER ="cache_carrier";
	
	public static final String CACHE_DICTS ="cache_dicts";
	
	//ProvinceCity 数据级别 1省份，直辖市，2省会，3地级市
	public static final short LEVEL_TYPE_PROVINCE = 1;
	
	public static final String TREENODE_STATE_OPEN = "open";
	public static final String TREENODE_STATE_CLOSED = "closed";
	
	/**
	 * 数据中心数据操作状态
	 */
	public static final String DC_DATA_ACTION_INSERT ="INSERT";
	public static final String DC_DATA_ACTION_UPDATE ="UPDATE";
	public static final String DC_DATA_ACTION_ENABLE ="ENABLE";
	public static final String DC_DATA_ACTION_DISABLE ="DISABLE";
	
	//角色类型 1 操作角色，2 数据角色
	public static final String SYS_ROLE_TYPE_OPERATE = "1";
	public static final String SYS_ROLE_TYPE_DATA_AUTH = "2";
	
	//已审核，未审核
	public static final String SYS_VERIFY_WSH = "0";
	public static final String SYS_VERIFY_YSH = "1";
	//驳回
	public static final String SYS_VERIFY_BH = "2";
	
	/**
	 * 湖北中烟组织机构数据根节点ID值
	 */
	public static final String HBZY_ORGANIZATION_ROOT_ID = "20420000";
	
	//成功标志
    public static final String RES_SUCCESS ="success";
    //失败编码
    public static final String RES_FAILED="error";
    
    // 操作记录
    public static final String TYPE_OPERATION = "1";
    // 异常记录
    public static final String TYPE_EXCEPTION = "2";
    
    //运行
    public static final String CNC_MACH_STATUS_RUNNING ="Running";
    //停止
    public static final String CNC_MACH_STATUS_STANDBY ="StandBy";
    //报错
    public static final String CNC_MACH_STATUS_ALARM ="Alarm";
    //离线
    public static final String CNC_MACH_STATUS_OFFLINE ="OffLine";
    
    public static final String CNC_SHIFT_AM="08:30:00";
    public static final String CNC_SHIFT_PM="20:30:00";
    
    public static final String CNC_X_AM="X";
    public static final String CNC_Y_PM="Y";
    
    public static final String ACTIVATE_YES = "1";
    public static final String ACTIVATE_NO = "0";
}
